// Frame Interpolator
// Class that is supposed to interpolate between the frames for a given animation
// For now this will be done in the CPU side but in the future we can change it to
// do the calculations on a shader, GPU side.

#ifndef _FRAME_INTERPOLATOR_H_
#define _FRAME_INTERPOLATOR_H_


#define ANIMATOR AnimationManager::GetInstance()

#include "Frame.h"
//class CKeyFrame;
class CAnimation;
class FrameInterpolator
{
	//////////////////////////////////////////////////////////////////////////
	//	------------------------------------------------------------------	//
	//							DATA	MEMBERS								//
	//	------------------------------------------------------------------	//
	//////////////////////////////////////////////////////////////////////////

	// Animation this interpolator is using
	const CAnimation* m_pAnimation;

	// Current keyFrame
	CKeyFrame m_KeyFrame;

	// Current time
	float m_fTime;

public:
	// Default Constructor - Set variables to safe values
	FrameInterpolator(void);
	
	// Attaches an animation to the interpolator
	void SetAnimation(const CAnimation* pAnimation);

	// Adds time to the interpolator
	void AddTime(float fTime);

	// Sets the interpolator's time
	void SetTime(float fTime);

	// Interpolates between theanimations key-frames based
	// on the interpolator's current time
	void Process(void);
	
	// Destructor - Clean Up
	~FrameInterpolator(void);


};

#endif // _FRAME_INTERPOLATOR_H_